package city.spring.modules.medicalstation.drugwarehouseShelfExt.vo;

import city.spring.action.model.AbstractMedicineWarehousingShelflevel;
import city.spring.modules.medicalstation.drugwarehouseShelfExt.entity.DrugwarehouseShelfExtEntity;
import city.spring.modules.medicine.entity.MedicinewarehousingMedicineExtEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author 谢金婷
 * @date 2020/9/28 0004 16:48
 * @see MedicinewarehousingMedicineExtEntity
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class DrugwarehouseShelflevelVO extends DrugwarehouseShelfExtEntity {

    /**
     * 货架编号
     */
    private String shelfId;
    /**
     * 药品货架
     */
    private String shelfname;
    /**
     * 货架层次名称
     */
    private String sname;

    /**
     * 转换成出库时所需要的对象
     *
     * @return AbstractPlanUser
     */
    public AbstractMedicineWarehousingShelflevel<DrugwarehouseShelflevelVO> toWarehousingShelflevel() {
        DrugwarehouseShelflevelVO item = this;
        return new AbstractMedicineWarehousingShelflevel<DrugwarehouseShelflevelVO>() {

            @Override
            public Object getKey() {
                return item.getShelfId();
            }

            @Override
            public String getSname() {
                return item.getSname();
            }

            @Override
            public BigDecimal getWarehousingquantity() {
                return item.getWarehousingquantity();
            }

            @Override
            public DrugwarehouseShelflevelVO getObject() {
                return item;
            }
        };
    }
}
